package com.guigu.wenzhiyi.service.impl;

import com.guigu.wenzhiyi.mapper.MentalitytestMapper;
import com.guigu.wenzhiyi.pojo.Mentalitytest;
import com.guigu.wenzhiyi.service.MentalitytestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MentalitytestServiceImpl implements MentalitytestService {

    @Autowired
    MentalitytestMapper mentalitytestMapper;


    @Override
    public int insert(List<Mentalitytest> list) {
        int num=0;
        for (Mentalitytest bodytest : list) {
            num +=mentalitytestMapper.insert(bodytest);
        }
        return num;
    }

    @Override
    public int updates(List<Mentalitytest> list) {
        int num=0;
        for (Mentalitytest bodytest : list) {
            num +=mentalitytestMapper.updateByPrimaryKey(bodytest);
        }
        return num;
    }

    @Override
    public int delete(Integer id) {
        return mentalitytestMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Mentalitytest> list(Mentalitytest bodytest) {
        return mentalitytestMapper.listcha(bodytest);
    }
}
